<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //fill() 方法用一个固定值填充一个数组中从起始索引到终止索引内的全部元素。不包括终止索引。
        var arr1 = ['one','two','three','four','five'];
        console.log(arr1.fill('zero'));//省略start和end，填充范围为[0,arr1.length-1]

        var arr1 = ['one','two','three','four','five'];
        console.log(arr1.fill('zero',2));//省略end,填充范围为[start,arr1.length-1]

        var arr1 = ['one','two','three','four','five'];
        console.log(arr1.fill('zero',3,5));//填充范围为[start,end-1]
    </script>
</head>
<body>
    
</body>
</html>